﻿using PersistLayer.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PersistLayer.DAL
{
	public class Loja_SliderDAL
	{
		private Entities Entity;

		public Loja_SliderDAL()
		{
			Entity = new Entities();
		}

		public int Adicionar(Loja_Slider ls)
		{
			Entity.Loja_Slider.Add(ls);
			Entity.SaveChanges();
			return ls.ID;
		}

		public object ListarSlider(int lID)
		{
			return Entity.Loja_Slider.Where(a => a.LojaID == lID).ToList().Select(b => new { imagem = b.ImageUrl });
		}
	}
}
